/**
 * @description 存储用户数据
 * @description 效果类似于取值 dbName.path = value
 * @param {Object} context
 * @param {Object} payload dbName {String} 数据库名称
 * @param {Object} payload path {String} 存储路径
 * @param {Object} payload value {*} 需要存储的值
 * @param {Object} payload user {Boolean} 是否区分用户
 */
export async function dbSet({
    dispatch
}: any, {
    dbName = "sys",
    path = "",
    value = '',
    user = true
}: any = {}) {
    return dispatch('coreDb/set', {
        dbName,
        path,
        value,
        user
    }, {
        root: true
    })
}
/**
 * @description 效果类似于取值 dbName.path || defaultValue
 * @param {Object} context
 * @param {Object} payload dbName {String} 数据库名称
 * @param {Object} payload path {String} 存储路径
 * @param {Object} payload defaultValue {*} 取值失败的默认值
 * @param {Object} payload user {Boolean} 是否区分用户
 */
export async function dbGet({
    dispatch
}: any, {
    dbName = "sys",
    path = "",
    value = '',
    user = true
}: any = {}) {
    return dispatch('coreDb/get', {
        dbName,
        path,
        value,
        user
    }, {
        root: true
    })
}
export default {}